using BCW.Friends;
using UnityEngine;

public class FriendsButtonInSelectMode : MonoBehaviour
{
	[SerializeField]
	private GameObject friendsPanel;

	[SerializeField]
	private GameObject countMark;

	private void OnClick()
	{
		friendsPanel.SetActive(!friendsPanel.GetActive());
		if (friendsPanel.GetActive())
		{
			friendsPanel.GetComponent<FriendsInSelectModeUI>().SpriteFriendsButton = base.gameObject.GetComponent<UIBasicSprite>();
		}
	}

	private void Update()
	{
		int num = (FriendsController.instance ? FriendsController.instance.IdsFrinedsInviteToBattle.Count : 0);
		if (num > 0)
		{
			countMark.GetComponentInChildren<UILabel>().text = num.ToString();
		}
		countMark.SetActive(num > 0);
	}
}
